﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/LightHouse.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Technique Error</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        function delayedRedirect() {
            window.location = '/';
        }

        setTimeout("delayedRedirect()", 7000);
    </script>

    <br />
    <br />
    <br />
    <%-- <div style="z-index:9999999999; text-align: center; width: 100%; left: 200px; top: 445px; padding: 0px; position: absolute;">
           
    </div>--%>
    <div style="width: 100%; font-size: 12pt; font-weight: bold; background-color: white; text-align: center; color: #9aaf6a; border-color: #9aaf6b;">
        <%= System.Configuration.ConfigurationManager.AppSettings["SiteName2"] %> is experiencing technical difficulties.<br />
        We apologize for the inconvenience.<br />
        You will be forward to the home page.  Please try again later.</div>
    <%
        if (System.Configuration.ConfigurationManager.AppSettings["ErrorLogging"] == "email")
        {
            string error = string.Format("Error at: {0}", Request.Url);
            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
            message.From = new System.Net.Mail.MailAddress("ngothanhtung.it@gmail.com");
            message.CC.Add(new System.Net.Mail.MailAddress("ngothanhtung.it@gmail.com"));
            message.To.Add(new System.Net.Mail.MailAddress("johnngoit@gmail.com"));
            message.Subject = "Error on " + System.Configuration.ConfigurationManager.AppSettings["SiteName2"] + " Production at " + DateTime.Now.ToString();
            message.Body = error;
            message.IsBodyHtml = true;

            System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
            smtp.Send(message);
        }
    %>
</asp:Content>
